package videoCapture;

import java.net.SocketException;

public class P2PClient {
	public static void main(String[] args) throws Exception {
		VideoP2P1 v1 = new VideoP2P1();
		VideoP2P2 v2 = new VideoP2P2();
		AudioP2P1 a1 = new AudioP2P1();
		AudioP2P2 a2 = new AudioP2P2();
		
		Thread tv1 = new Thread(v1);
		Thread tv2 = new Thread(v2);
		Thread ta1 = new Thread(a1);
		Thread ta2 = new Thread(a2);
		
		if (args.length != 0) {
			String[] st = args[0].split("\\.");

			byte[] tb = { (byte) Integer.parseInt(st[0]),
					(byte) Integer.parseInt(st[1]), (byte) Integer.parseInt(st[2]),
					(byte) Integer.parseInt(st[3]) };
			v1.setIP(tb);
			a1.setIP(tb);
		}
		tv1.start();
		tv2.start();
		ta1.start();
		ta2.start();
	}
}
